package com.hiwan.system.web.uuid;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hiwan.system.common.base.BaseController;
import com.hiwan.system.util.UUIDUtil;

@Controller
@RequestMapping("/uuid")
public class UuidController extends BaseController{

	protected Logger logger = LoggerFactory.getLogger(UuidController.class);

//	@Autowired
//	private UuidService uuidService;

	@RequestMapping("getUUID")
	public void getUUID(HttpServletResponse response){
		String uuid = UUIDUtil.getUUID();
		response.setCharacterEncoding("UTF-8");
		response.setContentType("application/json; charset=utf-8");  
		PrintWriter out=null;
		try {
			out = response.getWriter();
			out.append(uuid);
		} catch (IOException e) {
			out.append("获取uuid异常");
			e.printStackTrace();
		} 
	}
}
